package com.cisc.business.product.service.impl;

import com.cisc.business.product.dao.ProductMapper;
import com.cisc.business.product.dto.ProductInfo;
import com.cisc.business.product.service.ProductService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @description: XXX
 * @author: daizh
 * @time: 2021/6/20 13:44
 */
@Service
public class ProductServiceImpl implements ProductService {

    @Resource
    private ProductMapper productMapper;

    @Override
    public ProductInfo getProductByProductId(Integer productId) {
        return productMapper.getProductByProductId(productId);
    }

    @Override
    public ProductInfo getProductByProductCode(String productCode) {
        return productMapper.getProductByProductCode(productCode);
    }

    @Override
    public List<ProductInfo> getAllProducts() {
        return productMapper.getAllProducts();
    }

    @Override
    public void saveProduct(ProductInfo productInfo) {
        productMapper.saveProduct(productInfo);
    }
}
